%     AERO LOAD - программа для нагружения агрегатов самолета распределенной нагрузкой
%     Copyright (C) 2018-2024  Михаил Козлов
%     Сайт проекта: <http://www.fastenerdoctor.ru/>
%     Адрес электронной почты для связи с разработчиком:
%     <doctor.fastener@gmail.com>
% 
%     Эта программа является свободным программным обеспечением: Вы можете
%     распространять ее и/или изменять, соблюдая условия Универсальной общественной
%     лицензии GNU, опубликованной Фондом свободного программного обеспечения,
%     либо редакции 3, либо (на Ваше усмотрение) любой редакции, выпущенной позже.
% 
%     Эта программа распространяется в надежде на то, что она окажется полезной,
%     но БЕЗ КАКИХ-ЛИБО ГАРАНТИЙ, включая даже подразумеваемую гарантию ТОВАРНОЙ ПРИГОДНОСТИ,
%     либо ПРИГОДНОСТИ ДЛЯ ОПРЕДЕЛЕННЫХ ЦЕЛЕЙ. Ознакомьтесь с Универсальной общественной
%     лицензией GNU для получения более подробной информации.
% 
%     Вы должны были получить копию Универсальной общественной лицензии GNU
%     вместе с этой программой. Если Вы ее не получили, то перейдите по адресу:
%     <http://www.gnu.org/licenses/>.
% 
%     This program is free software: you can redistribute it and/or modify
%     it under the terms of the GNU General Public License as published by
%     the Free Software Foundation, either version 3 of the License, or
%     (at your option) any later version.
% 
%     This program is distributed in the hope that it will be useful,
%     but WITHOUT ANY WARRANTY; without even the implied warranty of
%     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
%     GNU General Public License for more details.
% 
%     You should have received a copy of the GNU General Public License
%     along with this program.  If not, see <https://www.gnu.org/licenses/>.

function GW_Plot_Erase_Resultants(src,~)

global Graphic_Window_Handle;
global Graphics_Properties;
global Graphics;
global DB_COORD;
global AT_COORD;

Axes_Handle = findall(Graphic_Window_Handle, 'Tag', 'Main_Axes');

switch src.Tag
    
    case 'Plot_Resultants_Button'
        
        % Erase
        tmp.Value = 1;
        tmp.Tag = 'Erase_Resultants_Button';
        GW_Plot_Erase_Resultants(tmp,[]);
        
        % Draw_Summation_Point_Button
        tmp.Value = 1;
        tmp.Tag = 'Draw_Summation_Point_Button';
        GW_Plot_Erase_Resultants(tmp,[]);
        set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 1);
        
        % Draw_Coord_System_Button
        tmp.Value = 1;
        tmp.Tag = 'Draw_Coord_System_Button';
        GW_Plot_Erase_Resultants(tmp,[]);
        set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 1);
        
        % Draw_Force_Resultant_Button / Draw_Force_XYZ_Button
        tmp.Value = 1;
        if (strcmp(Graphics.Load.Distributed_Load_Mode, 'CID_DISTR_LOAD'))
            tmp.Tag = 'Draw_Force_Resultant_Button';
        else
            tmp.Tag = 'Draw_Force_XYZ_Button';
        end
        GW_Plot_Erase_Resultants(tmp,[]);
        set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 1);
        
        % Draw_Moment_XYZ_Button
        tmp.Value = 1;
        tmp.Tag = 'Draw_Moment_XYZ_Button';
        GW_Plot_Erase_Resultants(tmp,[]);
        set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 1);
        
        % Draw_Actual_Pressure_Center_Button
        tmp.Value = 1;
        tmp.Tag = 'Draw_Actual_Pressure_Center_Button';
        GW_Plot_Erase_Resultants(tmp,[]);
        set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 1);
        
    case 'Erase_Resultants_Button'
        
        tmp.Value = 0;
        tmp.Tag = 'Draw_Summation_Point_Button';
        GW_Plot_Erase_Resultants(tmp,[]);
        set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 0);
        
        tmp.Value = 0;
        tmp.Tag = 'Draw_Coord_System_Button';
        GW_Plot_Erase_Resultants(tmp,[]);
        set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 0);
        
        tmp.Value = 0;
        tmp.Tag = 'Draw_Force_Resultant_Button';
        GW_Plot_Erase_Resultants(tmp,[]);
        set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 0);
        
        tmp.Value = 0;
        tmp.Tag = 'Draw_Force_Pn_Pt_Button';
        GW_Plot_Erase_Resultants(tmp,[]);
        set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 0);
        
        tmp.Value = 0;
        tmp.Tag = 'Draw_Force_XYZ_Button';
        GW_Plot_Erase_Resultants(tmp,[]);
        set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 0);
        
        tmp.Value = 0;
        tmp.Tag = 'Draw_Moment_Resultant_Button';
        GW_Plot_Erase_Resultants(tmp,[]);
        set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 0);
        
        tmp.Value = 0;
        tmp.Tag = 'Draw_Moment_XYZ_Button';
        GW_Plot_Erase_Resultants(tmp,[]);
        set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 0);
        
        tmp.Value = 0;
        tmp.Tag = 'Draw_Actual_Pressure_Center_Button';
        GW_Plot_Erase_Resultants(tmp,[]);
        set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 0);
        
    case 'Draw_Summation_Point_Button'
        
        if (src.Value == 1)
            
            Sphere_Mesh_Density = Graphics_Properties.Sphere_Mesh_Density;
            Point_Radius = Graphics.Summation_Point_Radius;
            Points_Color = Graphics_Properties.Summation_Point_Color;
            
            [Sphere_X, Sphere_Y, Sphere_Z] = sphere(Graphics_Properties.Sphere_Mesh_Density);

            Tmp_X = Sphere_X*Point_Radius + ones(Sphere_Mesh_Density+1)*Graphics.Load.Summation_Point(1);
            Tmp_Y = Sphere_Y*Point_Radius + ones(Sphere_Mesh_Density+1)*Graphics.Load.Summation_Point(2);
            Tmp_Z = Sphere_Z*Point_Radius + ones(Sphere_Mesh_Density+1)*Graphics.Load.Summation_Point(3);

            Sphere_Handle = surface(Axes_Handle, Tmp_X, Tmp_Y, Tmp_Z);

            set(Sphere_Handle, 'FaceColor', Points_Color);
            set(Sphere_Handle, 'EdgeColor', 'none');
            set(Sphere_Handle, 'Tag', 'Summation_Point');
            
            % Активировать кнопку
            set(findall(Graphic_Window_Handle, 'Tag', 'Label_Summation_Point_Button'), 'Enable', 'on');
            
        else
            
            % Удалить данные и деактивировать кнопку
            tmp.Value = 0;
            tmp.Tag = 'Label_Summation_Point_Button';
            GW_Plot_Erase_Resultants(tmp,[]);
            set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 0, 'Enable', 'off');
            
            delete(findall(Graphic_Window_Handle, 'Tag', 'Summation_Point'));
            
        end
        
    case 'Label_Summation_Point_Button'
        
        if (src.Value == 1)
            
            switch Graphics_Properties.Language
                case 'RU'
                    string = '     Точка суммирования';
                case 'EN'
                    string = '     Summation point';
            end
            
            if (isequal(get(Graphic_Window_Handle, 'Color'), [0 0 0]))
                Color = 'white';
            else
                Color = 'black';
            end

            Label_Handle = text(Axes_Handle, Graphics.Load.Summation_Point(1), Graphics.Load.Summation_Point(2),Graphics.Load.Summation_Point(3), string);
            set(Label_Handle, 'Color', Color, 'Tag', 'Summation_Point_Label');
            
            % Активировать кнопку
            set(findall(Graphic_Window_Handle, 'Tag', 'Summation_Point_Coord_Button'), 'Enable', 'on');
            
        else
            
            % Удалить данные и деактивировать кнопку
            tmp.Value = 0;
            tmp.Tag = 'Summation_Point_Coord_Button';
            GW_Plot_Erase_Resultants(tmp,[]);
            set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 0, 'Enable', 'off');
            
            delete(findall(Graphic_Window_Handle, 'Tag', 'Summation_Point_Label'));
            
        end
        
    case 'Summation_Point_Coord_Button'
        
        if (src.Value == 1)
            
            handle = findall(Graphic_Window_Handle, 'Tag', 'Summation_Point_Label');
            if (~isempty(handle))
                handle.String = [handle.String sprintf('   [%g, %g, %g]', Graphics.Load.Summation_Point(1), Graphics.Load.Summation_Point(2), Graphics.Load.Summation_Point(3))];
            end
            
        else
            
            switch Graphics_Properties.Language
                case 'RU'
                    index = 23;
                case 'EN'
                    index = 20;
            end
            
            handle = findall(Graphic_Window_Handle, 'Tag', 'Summation_Point_Label');
            if (~isempty(handle))
                handle.String = handle.String(1:index);
            end
            
        end
        
    case 'Draw_Coord_System_Button'
        
        if (src.Value == 1)
            
            e_z = Graphics.Load.Point_On_Axis_3 - Graphics.Load.Coord_Origin;
            e_z = e_z / norm(e_z);
            
            e_y = cross(e_z, Graphics.Load.Point_On_Plane_13 - Graphics.Load.Coord_Origin);
            e_y = e_y / norm(e_y);
            
            e_x = cross(e_y, e_z);
            e_x = e_x / norm(e_x);
            
            Coord_Axes_Data = NaN(9,3);
            Coord_Axes_Data(1,:) = Graphics.Load.Coord_Origin';
            Coord_Axes_Data(2,:) = (Graphics.Load.Coord_Origin + e_x*Graphics.Summation_Coord_Axis_Length)';
            Coord_Axes_Data(4,:) = Graphics.Load.Coord_Origin';
            Coord_Axes_Data(5,:) = (Graphics.Load.Coord_Origin + e_y*Graphics.Summation_Coord_Axis_Length)';
            Coord_Axes_Data(7,:) = Graphics.Load.Coord_Origin';
            Coord_Axes_Data(8,:) = (Graphics.Load.Coord_Origin + e_z*Graphics.Summation_Coord_Axis_Length)';
            
            Coord_Axes_Handle = plot3(Axes_Handle, Coord_Axes_Data(:,1), Coord_Axes_Data(:,2), Coord_Axes_Data(:,3));

            set(Coord_Axes_Handle, 'Color', Graphics_Properties.Summation_Coord_Color);
            set(Coord_Axes_Handle, 'Tag', 'Summation_Coord_Axes');
            
            if (isequal(get(Graphic_Window_Handle, 'Color'), [0 0 0]))
                Color = 'white';
            else
                Color = 'black';
            end
            
            Label_Offset = Graphics_Properties.Summation_Coord_Label_Offset;

            X_Label_Handle = text(Axes_Handle, Coord_Axes_Data(2,1) + e_x(1)*Label_Offset, Coord_Axes_Data(2,2) + e_x(2)*Label_Offset, Coord_Axes_Data(2,3) + e_x(3)*Label_Offset, 'X');
            set(X_Label_Handle, 'Color', Color);
            set(X_Label_Handle, 'Tag', 'Summation_Coord_X_Label');

            Y_Label_Handle = text(Axes_Handle, Coord_Axes_Data(5,1) + e_y(1)*Label_Offset, Coord_Axes_Data(5,2) + e_y(2)*Label_Offset, Coord_Axes_Data(5,3) + e_y(3)*Label_Offset, 'Y');
            set(Y_Label_Handle, 'Color', Color);
            set(Y_Label_Handle, 'Tag', 'Summation_Coord_Y_Label');

            Z_Label_Handle = text(Axes_Handle, Coord_Axes_Data(8,1) + e_z(1)*Label_Offset, Coord_Axes_Data(8,2) + e_z(2)*Label_Offset, Coord_Axes_Data(8,3) + e_z(3)*Label_Offset, 'Z');
            set(Z_Label_Handle, 'Color', Color);
            set(Z_Label_Handle, 'Tag', 'Summation_Coord_Z_Label');
            
        else
            
            delete(findall(Graphic_Window_Handle, 'Tag', 'Summation_Coord_Axes'));
            delete(findall(Graphic_Window_Handle, 'Tag', 'Summation_Coord_X_Label'));
            delete(findall(Graphic_Window_Handle, 'Tag', 'Summation_Coord_Y_Label'));
            delete(findall(Graphic_Window_Handle, 'Tag', 'Summation_Coord_Z_Label'));
            
        end
        
    case 'Draw_Force_Resultant_Button'
        
        if (src.Value == 1)
            
            Force_vector = Graphics.Load_Summary.Actual_Total_Force_Vector / norm(Graphics.Load_Summary.Actual_Total_Force_Vector);
            
            Tmp_Vector_1 = Graphics.Load.Chord_Surface.A1_projected - Graphics.Load.Chord_Surface.A2_projected;
            Tmp_Vector_1 = Tmp_Vector_1/norm(Tmp_Vector_1);

            Tmp_Vector_2 = cross(Tmp_Vector_1, Force_vector);
            if (norm(Tmp_Vector_2) < 1e-6)
                Tmp_Vector_2 = cross(Graphics.Load.Vector, Force_vector);
            end
            Tmp_Vector_2 = Tmp_Vector_2/norm(Tmp_Vector_2);

            Tmp_Vector_1 = cross(Force_vector, Tmp_Vector_2);
            Tmp_Vector_1 = Tmp_Vector_1/norm(Tmp_Vector_1);

            Tmp_Data = zeros(10,3);

            Tmp_Data(1,:) = Graphics.Load_Summary.Actual_Pressure_Center_XYZ_Projected';
            Tmp_Data(2,:) = Tmp_Data(1,:) + Force_vector' * Graphics.Force_Length;
            Tmp_Data(3,:) = Tmp_Data(2,:) - (Graphics_Properties.Force_Arrow_Size_2 * Graphics.Force_Length * Tmp_Vector_1)' - (Force_vector * Graphics.Force_Length * Graphics_Properties.Force_Arrow_Size_1)';
            Tmp_Data(4,:) = Tmp_Data(3,:) + (Graphics_Properties.Force_Arrow_Size_2 * Graphics.Force_Length * Tmp_Vector_1)';
            Tmp_Data(5,:) = Tmp_Data(4,:) + (Graphics_Properties.Force_Arrow_Size_2 * Graphics.Force_Length * Tmp_Vector_2)';
            Tmp_Data(6,:) = Tmp_Data(5,:) - (Graphics_Properties.Force_Arrow_Size_2 * Graphics.Force_Length * Tmp_Vector_2)' + (Force_vector * Graphics.Force_Length * Graphics_Properties.Force_Arrow_Size_1)';
            Tmp_Data(7,:) = Tmp_Data(6,:) + (Graphics_Properties.Force_Arrow_Size_2 * Graphics.Force_Length * Tmp_Vector_1)' - (Force_vector * Graphics.Force_Length * Graphics_Properties.Force_Arrow_Size_1)';
            Tmp_Data(8,:) = Tmp_Data(7,:) - (Graphics_Properties.Force_Arrow_Size_2 * Graphics.Force_Length * Tmp_Vector_1)';
            Tmp_Data(9,:) = Tmp_Data(8,:) - (Graphics_Properties.Force_Arrow_Size_2 * Graphics.Force_Length * Tmp_Vector_2)';
            Tmp_Data(10,:) = Tmp_Data(2,:);
            
            Force_Resultant_Handle = plot3(Axes_Handle, Tmp_Data(:,1), Tmp_Data(:,2), Tmp_Data(:,3));

            set(Force_Resultant_Handle, 'Color', Graphics_Properties.P_Vector_Color);
            set(Force_Resultant_Handle, 'LineWidth', Graphics_Properties.Force_Line_Width);
            set(Force_Resultant_Handle, 'Tag', 'Force_Resultant');
            
            if (isequal(get(Graphic_Window_Handle, 'Color'), [0 0 0]))
                Color = 'white';
            else
                Color = 'black';
            end

            Force_Resultant_Text_Handle = text(Axes_Handle, Tmp_Data(2,1), Tmp_Data(2,2), Tmp_Data(2,3), sprintf('  %.3f', abs(Graphics.Load_Summary.Actual_Total_Force)));
            set(Force_Resultant_Text_Handle, 'Color', Color);
            set(Force_Resultant_Text_Handle, 'FontSize', Graphics_Properties.Force_Font_Size);
            set(Force_Resultant_Text_Handle, 'Tag', 'Force_Resultant_Label');
            
            tmp.Value = 0;
            tmp.Tag = 'Draw_Force_Pn_Pt_Button';
            GW_Plot_Erase_Resultants(tmp,[]);
            set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 0);

            tmp.Value = 0;
            tmp.Tag = 'Draw_Force_XYZ_Button';
            GW_Plot_Erase_Resultants(tmp,[]);
            set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 0);
            
        else
            
            delete(findall(Graphic_Window_Handle, 'Tag', 'Force_Resultant'));
            delete(findall(Graphic_Window_Handle, 'Tag', 'Force_Resultant_Label'));
            
        end
        
    case 'Draw_Force_Pn_Pt_Button'
        
        if (src.Value == 1)
            
            % --------- Pn ---------
            
            Force_vector = Graphics.Load_Summary.Actual_Total_Force_Pn_Vector / norm(Graphics.Load_Summary.Actual_Total_Force_Pn_Vector);
            
            Tmp_Vector_1 = Graphics.Load.Chord_Surface.A1_projected - Graphics.Load.Chord_Surface.A2_projected;
            Tmp_Vector_1 = Tmp_Vector_1/norm(Tmp_Vector_1);

            Tmp_Vector_2 = cross(Tmp_Vector_1, Force_vector);
            if (norm(Tmp_Vector_2) < 1e-6)
                Tmp_Vector_2 = cross(Graphics.Load.Vector, Force_vector);
            end
            Tmp_Vector_2 = Tmp_Vector_2/norm(Tmp_Vector_2);

            Tmp_Vector_1 = cross(Force_vector, Tmp_Vector_2);
            Tmp_Vector_1 = Tmp_Vector_1/norm(Tmp_Vector_1);

            Tmp_Data = zeros(10,3);

            Tmp_Data(1,:) = Graphics.Load_Summary.Actual_Pressure_Center_XYZ_Projected';
            Tmp_Data(2,:) = Tmp_Data(1,:) + Force_vector' * Graphics.Force_Length;
            Tmp_Data(3,:) = Tmp_Data(2,:) - (Graphics_Properties.Force_Arrow_Size_2 * Graphics.Force_Length * Tmp_Vector_1)' - (Force_vector * Graphics.Force_Length * Graphics_Properties.Force_Arrow_Size_1)';
            Tmp_Data(4,:) = Tmp_Data(3,:) + (Graphics_Properties.Force_Arrow_Size_2 * Graphics.Force_Length * Tmp_Vector_1)';
            Tmp_Data(5,:) = Tmp_Data(4,:) + (Graphics_Properties.Force_Arrow_Size_2 * Graphics.Force_Length * Tmp_Vector_2)';
            Tmp_Data(6,:) = Tmp_Data(5,:) - (Graphics_Properties.Force_Arrow_Size_2 * Graphics.Force_Length * Tmp_Vector_2)' + (Force_vector * Graphics.Force_Length * Graphics_Properties.Force_Arrow_Size_1)';
            Tmp_Data(7,:) = Tmp_Data(6,:) + (Graphics_Properties.Force_Arrow_Size_2 * Graphics.Force_Length * Tmp_Vector_1)' - (Force_vector * Graphics.Force_Length * Graphics_Properties.Force_Arrow_Size_1)';
            Tmp_Data(8,:) = Tmp_Data(7,:) - (Graphics_Properties.Force_Arrow_Size_2 * Graphics.Force_Length * Tmp_Vector_1)';
            Tmp_Data(9,:) = Tmp_Data(8,:) - (Graphics_Properties.Force_Arrow_Size_2 * Graphics.Force_Length * Tmp_Vector_2)';
            Tmp_Data(10,:) = Tmp_Data(2,:);
            
            Force_Pn_Handle = plot3(Axes_Handle, Tmp_Data(:,1), Tmp_Data(:,2), Tmp_Data(:,3));

            set(Force_Pn_Handle, 'Color', Graphics_Properties.Pn_Vector_Color);
            set(Force_Pn_Handle, 'LineWidth', Graphics_Properties.Force_Line_Width);
            set(Force_Pn_Handle, 'Tag', 'Force_Pn_Pt');
            
            if (isequal(get(Graphic_Window_Handle, 'Color'), [0 0 0]))
                Color = 'white';
            else
                Color = 'black';
            end

            Force_Pn_Text_Handle = text(Axes_Handle, Tmp_Data(2,1), Tmp_Data(2,2), Tmp_Data(2,3), sprintf('  %.3f', abs(Graphics.Load_Summary.Actual_Total_Force_Pn)));
            set(Force_Pn_Text_Handle, 'Color', Color);
            set(Force_Pn_Text_Handle, 'FontSize', Graphics_Properties.Force_Font_Size);
            set(Force_Pn_Text_Handle, 'Tag', 'Force_Pn_Pt_Label');
            
            % --------- Pt ---------
            
            if (Graphics.Load_Summary.Actual_Total_Force_Pt >= 1e-6)
                
                Force_vector = Graphics.Load_Summary.Actual_Total_Force_Pt_Vector / norm(Graphics.Load_Summary.Actual_Total_Force_Pt_Vector);
                
            else
                
                Tmp_Vector_1 = Graphics.Load.Chord_Surface.A1_projected - Graphics.Load.Chord_Surface.A3_projected;
                Tmp_Vector_1 = Tmp_Vector_1/norm(Tmp_Vector_1);
                
                Tmp_Vector_2 = Graphics.Load.Chord_Surface.A2_projected - Graphics.Load.Chord_Surface.A4_projected;
                Tmp_Vector_2 = Tmp_Vector_2/norm(Tmp_Vector_2);
                
                Force_vector = (Tmp_Vector_1 + Tmp_Vector_2) / 2;
                Force_vector = Force_vector / norm(Force_vector);
                
            end
            
            Tmp_Vector_1 = Graphics.Load.Chord_Surface.A1_projected - Graphics.Load.Chord_Surface.A2_projected;
            Tmp_Vector_1 = Tmp_Vector_1/norm(Tmp_Vector_1);

            Tmp_Vector_2 = cross(Tmp_Vector_1, Force_vector);
            if (norm(Tmp_Vector_2) < 1e-6)
                Tmp_Vector_2 = cross(Graphics.Load.Vector, Force_vector);
            end
            Tmp_Vector_2 = Tmp_Vector_2/norm(Tmp_Vector_2);

            Tmp_Vector_1 = cross(Force_vector, Tmp_Vector_2);
            Tmp_Vector_1 = Tmp_Vector_1/norm(Tmp_Vector_1);

            Tmp_Data = zeros(10,3);

            Tmp_Data(1,:) = Graphics.Load_Summary.Actual_Pressure_Center_XYZ_Projected';
            Tmp_Data(2,:) = Tmp_Data(1,:) + Force_vector' * Graphics.Force_Length;
            Tmp_Data(3,:) = Tmp_Data(2,:) - (Graphics_Properties.Force_Arrow_Size_2 * Graphics.Force_Length * Tmp_Vector_1)' - (Force_vector * Graphics.Force_Length * Graphics_Properties.Force_Arrow_Size_1)';
            Tmp_Data(4,:) = Tmp_Data(3,:) + (Graphics_Properties.Force_Arrow_Size_2 * Graphics.Force_Length * Tmp_Vector_1)';
            Tmp_Data(5,:) = Tmp_Data(4,:) + (Graphics_Properties.Force_Arrow_Size_2 * Graphics.Force_Length * Tmp_Vector_2)';
            Tmp_Data(6,:) = Tmp_Data(5,:) - (Graphics_Properties.Force_Arrow_Size_2 * Graphics.Force_Length * Tmp_Vector_2)' + (Force_vector * Graphics.Force_Length * Graphics_Properties.Force_Arrow_Size_1)';
            Tmp_Data(7,:) = Tmp_Data(6,:) + (Graphics_Properties.Force_Arrow_Size_2 * Graphics.Force_Length * Tmp_Vector_1)' - (Force_vector * Graphics.Force_Length * Graphics_Properties.Force_Arrow_Size_1)';
            Tmp_Data(8,:) = Tmp_Data(7,:) - (Graphics_Properties.Force_Arrow_Size_2 * Graphics.Force_Length * Tmp_Vector_1)';
            Tmp_Data(9,:) = Tmp_Data(8,:) - (Graphics_Properties.Force_Arrow_Size_2 * Graphics.Force_Length * Tmp_Vector_2)';
            Tmp_Data(10,:) = Tmp_Data(2,:);
            
            Force_Pt_Handle = plot3(Axes_Handle, Tmp_Data(:,1), Tmp_Data(:,2), Tmp_Data(:,3));

            set(Force_Pt_Handle, 'Color', Graphics_Properties.Pt_Vector_Color);
            set(Force_Pt_Handle, 'LineWidth', Graphics_Properties.Force_Line_Width);
            set(Force_Pt_Handle, 'Tag', 'Force_Pn_Pt');
            
            if (isequal(get(Graphic_Window_Handle, 'Color'), [0 0 0]))
                Color = 'white';
            else
                Color = 'black';
            end

            Force_Pt_Text_Handle = text(Axes_Handle, Tmp_Data(2,1), Tmp_Data(2,2), Tmp_Data(2,3), sprintf('  %.3f', abs(Graphics.Load_Summary.Actual_Total_Force_Pt)));
            set(Force_Pt_Text_Handle, 'Color', Color);
            set(Force_Pt_Text_Handle, 'FontSize', Graphics_Properties.Force_Font_Size);
            set(Force_Pt_Text_Handle, 'Tag', 'Force_Pn_Pt_Label');
            
            % ----------------------
            
            tmp.Value = 0;
            tmp.Tag = 'Draw_Force_Resultant_Button';
            GW_Plot_Erase_Resultants(tmp,[]);
            set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 0);

            tmp.Value = 0;
            tmp.Tag = 'Draw_Force_XYZ_Button';
            GW_Plot_Erase_Resultants(tmp,[]);
            set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 0);
            
        else
            
            delete(findall(Graphic_Window_Handle, 'Tag', 'Force_Pn_Pt'));
            delete(findall(Graphic_Window_Handle, 'Tag', 'Force_Pn_Pt_Label'));
            
        end
        
    case 'Draw_Force_XYZ_Button'
        
        if (src.Value == 1)
            
            FX = dot(Graphics.Load_Summary.Actual_Total_Force_Vector, DB_COORD{AT_COORD(Graphics.Load_Summary.Summation_Coord)}.e_x);
            FY = dot(Graphics.Load_Summary.Actual_Total_Force_Vector, DB_COORD{AT_COORD(Graphics.Load_Summary.Summation_Coord)}.e_y);
            FZ = dot(Graphics.Load_Summary.Actual_Total_Force_Vector, DB_COORD{AT_COORD(Graphics.Load_Summary.Summation_Coord)}.e_z);
            
            % --------- FX ---------
            
            if (FX >= 0)
                Force_vector = DB_COORD{AT_COORD(Graphics.Load_Summary.Summation_Coord)}.e_x;
            else
                Force_vector = -DB_COORD{AT_COORD(Graphics.Load_Summary.Summation_Coord)}.e_x;
            end
            
            Tmp_Vector_1 = Graphics.Load.Chord_Surface.A1_projected - Graphics.Load.Chord_Surface.A2_projected;
            Tmp_Vector_1 = Tmp_Vector_1/norm(Tmp_Vector_1);

            Tmp_Vector_2 = cross(Tmp_Vector_1, Force_vector);
            if (norm(Tmp_Vector_2) < 1e-6)
                Tmp_Vector_2 = cross(Graphics.Load.Vector, Force_vector);
            end
            Tmp_Vector_2 = Tmp_Vector_2/norm(Tmp_Vector_2);

            Tmp_Vector_1 = cross(Force_vector, Tmp_Vector_2);
            Tmp_Vector_1 = Tmp_Vector_1/norm(Tmp_Vector_1);

            Tmp_Data = zeros(10,3);

            Tmp_Data(1,:) = Graphics.Load_Summary.Actual_Pressure_Center_XYZ_Projected';
            Tmp_Data(2,:) = Tmp_Data(1,:) + Force_vector' * Graphics.Force_Length;
            Tmp_Data(3,:) = Tmp_Data(2,:) - (Graphics_Properties.Force_Arrow_Size_2 * Graphics.Force_Length * Tmp_Vector_1)' - (Force_vector * Graphics.Force_Length * Graphics_Properties.Force_Arrow_Size_1)';
            Tmp_Data(4,:) = Tmp_Data(3,:) + (Graphics_Properties.Force_Arrow_Size_2 * Graphics.Force_Length * Tmp_Vector_1)';
            Tmp_Data(5,:) = Tmp_Data(4,:) + (Graphics_Properties.Force_Arrow_Size_2 * Graphics.Force_Length * Tmp_Vector_2)';
            Tmp_Data(6,:) = Tmp_Data(5,:) - (Graphics_Properties.Force_Arrow_Size_2 * Graphics.Force_Length * Tmp_Vector_2)' + (Force_vector * Graphics.Force_Length * Graphics_Properties.Force_Arrow_Size_1)';
            Tmp_Data(7,:) = Tmp_Data(6,:) + (Graphics_Properties.Force_Arrow_Size_2 * Graphics.Force_Length * Tmp_Vector_1)' - (Force_vector * Graphics.Force_Length * Graphics_Properties.Force_Arrow_Size_1)';
            Tmp_Data(8,:) = Tmp_Data(7,:) - (Graphics_Properties.Force_Arrow_Size_2 * Graphics.Force_Length * Tmp_Vector_1)';
            Tmp_Data(9,:) = Tmp_Data(8,:) - (Graphics_Properties.Force_Arrow_Size_2 * Graphics.Force_Length * Tmp_Vector_2)';
            Tmp_Data(10,:) = Tmp_Data(2,:);
            
            Force_FX = plot3(Axes_Handle, Tmp_Data(:,1), Tmp_Data(:,2), Tmp_Data(:,3));

            set(Force_FX, 'Color', Graphics_Properties.Px_Vector_Color);
            set(Force_FX, 'LineWidth', Graphics_Properties.Force_Line_Width);
            set(Force_FX, 'Tag', 'Force_XYZ');
            
            if (isequal(get(Graphic_Window_Handle, 'Color'), [0 0 0]))
                Color = 'white';
            else
                Color = 'black';
            end

            Force_FX_Text_Handle = text(Axes_Handle, Tmp_Data(2,1), Tmp_Data(2,2), Tmp_Data(2,3), sprintf('  %.3f', abs(FX)));
            set(Force_FX_Text_Handle, 'Color', Color);
            set(Force_FX_Text_Handle, 'FontSize', Graphics_Properties.Force_Font_Size);
            set(Force_FX_Text_Handle, 'Tag', 'Force_XYZ_Label');
            
            % --------- FY ---------
            
            if (FY >= 0)
                Force_vector = DB_COORD{AT_COORD(Graphics.Load_Summary.Summation_Coord)}.e_y;
            else
                Force_vector = -DB_COORD{AT_COORD(Graphics.Load_Summary.Summation_Coord)}.e_y;
            end
            
            Tmp_Vector_1 = Graphics.Load.Chord_Surface.A1_projected - Graphics.Load.Chord_Surface.A2_projected;
            Tmp_Vector_1 = Tmp_Vector_1/norm(Tmp_Vector_1);

            Tmp_Vector_2 = cross(Tmp_Vector_1, Force_vector);
            if (norm(Tmp_Vector_2) < 1e-6)
                Tmp_Vector_2 = cross(Graphics.Load.Vector, Force_vector);
            end
            Tmp_Vector_2 = Tmp_Vector_2/norm(Tmp_Vector_2);

            Tmp_Vector_1 = cross(Force_vector, Tmp_Vector_2);
            Tmp_Vector_1 = Tmp_Vector_1/norm(Tmp_Vector_1);

            Tmp_Data = zeros(10,3);

            Tmp_Data(1,:) = Graphics.Load_Summary.Actual_Pressure_Center_XYZ_Projected';
            Tmp_Data(2,:) = Tmp_Data(1,:) + Force_vector' * Graphics.Force_Length;
            Tmp_Data(3,:) = Tmp_Data(2,:) - (Graphics_Properties.Force_Arrow_Size_2 * Graphics.Force_Length * Tmp_Vector_1)' - (Force_vector * Graphics.Force_Length * Graphics_Properties.Force_Arrow_Size_1)';
            Tmp_Data(4,:) = Tmp_Data(3,:) + (Graphics_Properties.Force_Arrow_Size_2 * Graphics.Force_Length * Tmp_Vector_1)';
            Tmp_Data(5,:) = Tmp_Data(4,:) + (Graphics_Properties.Force_Arrow_Size_2 * Graphics.Force_Length * Tmp_Vector_2)';
            Tmp_Data(6,:) = Tmp_Data(5,:) - (Graphics_Properties.Force_Arrow_Size_2 * Graphics.Force_Length * Tmp_Vector_2)' + (Force_vector * Graphics.Force_Length * Graphics_Properties.Force_Arrow_Size_1)';
            Tmp_Data(7,:) = Tmp_Data(6,:) + (Graphics_Properties.Force_Arrow_Size_2 * Graphics.Force_Length * Tmp_Vector_1)' - (Force_vector * Graphics.Force_Length * Graphics_Properties.Force_Arrow_Size_1)';
            Tmp_Data(8,:) = Tmp_Data(7,:) - (Graphics_Properties.Force_Arrow_Size_2 * Graphics.Force_Length * Tmp_Vector_1)';
            Tmp_Data(9,:) = Tmp_Data(8,:) - (Graphics_Properties.Force_Arrow_Size_2 * Graphics.Force_Length * Tmp_Vector_2)';
            Tmp_Data(10,:) = Tmp_Data(2,:);
            
            Force_FY = plot3(Axes_Handle, Tmp_Data(:,1), Tmp_Data(:,2), Tmp_Data(:,3));

            set(Force_FY, 'Color', Graphics_Properties.Py_Vector_Color);
            set(Force_FY, 'LineWidth', Graphics_Properties.Force_Line_Width);
            set(Force_FY, 'Tag', 'Force_XYZ');
            
            if (isequal(get(Graphic_Window_Handle, 'Color'), [0 0 0]))
                Color = 'white';
            else
                Color = 'black';
            end

            Force_FY_Text_Handle = text(Axes_Handle, Tmp_Data(2,1), Tmp_Data(2,2), Tmp_Data(2,3), sprintf('  %.3f', abs(FY)));
            set(Force_FY_Text_Handle, 'Color', Color);
            set(Force_FY_Text_Handle, 'FontSize', Graphics_Properties.Force_Font_Size);
            set(Force_FY_Text_Handle, 'Tag', 'Force_XYZ_Label');
            
            % --------- FZ ---------
            
            if (FZ >= 0)
                Force_vector = DB_COORD{AT_COORD(Graphics.Load_Summary.Summation_Coord)}.e_z;
            else
                Force_vector = -DB_COORD{AT_COORD(Graphics.Load_Summary.Summation_Coord)}.e_z;
            end
            
            Tmp_Vector_1 = Graphics.Load.Chord_Surface.A1_projected - Graphics.Load.Chord_Surface.A2_projected;
            Tmp_Vector_1 = Tmp_Vector_1/norm(Tmp_Vector_1);

            Tmp_Vector_2 = cross(Tmp_Vector_1, Force_vector);
            if (norm(Tmp_Vector_2) < 1e-6)
                Tmp_Vector_2 = cross(Graphics.Load.Vector, Force_vector);
            end
            Tmp_Vector_2 = Tmp_Vector_2/norm(Tmp_Vector_2);

            Tmp_Vector_1 = cross(Force_vector, Tmp_Vector_2);
            Tmp_Vector_1 = Tmp_Vector_1/norm(Tmp_Vector_1);

            Tmp_Data = zeros(10,3);

            Tmp_Data(1,:) = Graphics.Load_Summary.Actual_Pressure_Center_XYZ_Projected';
            Tmp_Data(2,:) = Tmp_Data(1,:) + Force_vector' * Graphics.Force_Length;
            Tmp_Data(3,:) = Tmp_Data(2,:) - (Graphics_Properties.Force_Arrow_Size_2 * Graphics.Force_Length * Tmp_Vector_1)' - (Force_vector * Graphics.Force_Length * Graphics_Properties.Force_Arrow_Size_1)';
            Tmp_Data(4,:) = Tmp_Data(3,:) + (Graphics_Properties.Force_Arrow_Size_2 * Graphics.Force_Length * Tmp_Vector_1)';
            Tmp_Data(5,:) = Tmp_Data(4,:) + (Graphics_Properties.Force_Arrow_Size_2 * Graphics.Force_Length * Tmp_Vector_2)';
            Tmp_Data(6,:) = Tmp_Data(5,:) - (Graphics_Properties.Force_Arrow_Size_2 * Graphics.Force_Length * Tmp_Vector_2)' + (Force_vector * Graphics.Force_Length * Graphics_Properties.Force_Arrow_Size_1)';
            Tmp_Data(7,:) = Tmp_Data(6,:) + (Graphics_Properties.Force_Arrow_Size_2 * Graphics.Force_Length * Tmp_Vector_1)' - (Force_vector * Graphics.Force_Length * Graphics_Properties.Force_Arrow_Size_1)';
            Tmp_Data(8,:) = Tmp_Data(7,:) - (Graphics_Properties.Force_Arrow_Size_2 * Graphics.Force_Length * Tmp_Vector_1)';
            Tmp_Data(9,:) = Tmp_Data(8,:) - (Graphics_Properties.Force_Arrow_Size_2 * Graphics.Force_Length * Tmp_Vector_2)';
            Tmp_Data(10,:) = Tmp_Data(2,:);
            
            Force_FZ = plot3(Axes_Handle, Tmp_Data(:,1), Tmp_Data(:,2), Tmp_Data(:,3));

            set(Force_FZ, 'Color', Graphics_Properties.Pz_Vector_Color);
            set(Force_FZ, 'LineWidth', Graphics_Properties.Force_Line_Width);
            set(Force_FZ, 'Tag', 'Force_XYZ');
            
            if (isequal(get(Graphic_Window_Handle, 'Color'), [0 0 0]))
                Color = 'white';
            else
                Color = 'black';
            end

            Force_FZ_Text_Handle = text(Axes_Handle, Tmp_Data(2,1), Tmp_Data(2,2), Tmp_Data(2,3), sprintf('  %.3f', abs(FZ)));
            set(Force_FZ_Text_Handle, 'Color', Color);
            set(Force_FZ_Text_Handle, 'FontSize', Graphics_Properties.Force_Font_Size);
            set(Force_FZ_Text_Handle, 'Tag', 'Force_XYZ_Label');
            
            % ----------------
            
            tmp.Value = 0;
            tmp.Tag = 'Draw_Force_Resultant_Button';
            GW_Plot_Erase_Resultants(tmp,[]);
            set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 0);

            tmp.Value = 0;
            tmp.Tag = 'Draw_Force_Pn_Pt_Button';
            GW_Plot_Erase_Resultants(tmp,[]);
            set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 0);
            
        else
            
            delete(findall(Graphic_Window_Handle, 'Tag', 'Force_XYZ'));
            delete(findall(Graphic_Window_Handle, 'Tag', 'Force_XYZ_Label'));
            
        end
        
    case 'Draw_Moment_Resultant_Button'
        
        if (src.Value == 1)
            
            Moment_vector = Graphics.Load_Summary.Actual_Total_Moment_Vector / norm(Graphics.Load_Summary.Actual_Total_Moment_Vector);
            
            Tmp_Vector_1 = Graphics.Load.Chord_Surface.A1_projected - Graphics.Load.Chord_Surface.A2_projected;
            Tmp_Vector_1 = Tmp_Vector_1/norm(Tmp_Vector_1);

            Tmp_Vector_2 = cross(Tmp_Vector_1, Moment_vector);
            if (norm(Tmp_Vector_2) < 1e-6)
                Tmp_Vector_2 = cross(Graphics.Load.Vector, Moment_vector);
            end
            Tmp_Vector_2 = Tmp_Vector_2/norm(Tmp_Vector_2);

            Tmp_Vector_1 = cross(Moment_vector, Tmp_Vector_2);
            Tmp_Vector_1 = Tmp_Vector_1/norm(Tmp_Vector_1);

            Tmp_Data = zeros(20,3);

            Tmp_Data(1,:) = Graphics.Load.Summation_Point';
            Tmp_Data(2,:) = Tmp_Data(1,:) + Moment_vector' * Graphics.Moment_Length;
            Tmp_Data(3,:) = Tmp_Data(2,:) - (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_1)' - (Moment_vector * Graphics.Moment_Length * Graphics_Properties.Moment_Arrow_Size_1)';
            Tmp_Data(4,:) = Tmp_Data(3,:) + (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_1)';
            Tmp_Data(5,:) = Tmp_Data(4,:) + (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_2)';
            Tmp_Data(6,:) = Tmp_Data(5,:) - (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_2)' + (Moment_vector * Graphics.Moment_Length * Graphics_Properties.Moment_Arrow_Size_1)';
            Tmp_Data(7,:) = Tmp_Data(6,:) + (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_1)' - (Moment_vector * Graphics.Moment_Length * Graphics_Properties.Moment_Arrow_Size_1)';
            Tmp_Data(8,:) = Tmp_Data(7,:) - (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_1)';
            Tmp_Data(9,:) = Tmp_Data(8,:) - (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_2)';
            Tmp_Data(10,:) = Tmp_Data(2,:);
            Tmp_Data(11,:) = [NaN NaN NaN];
            Tmp_Data(12,:) = Tmp_Data(2,:) - (Moment_vector * Graphics.Moment_Length * Graphics_Properties.Moment_Arrow_Size_1)';
            Tmp_Data(13,:) = Tmp_Data(12,:) - (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_1)' - (Moment_vector * Graphics.Moment_Length * Graphics_Properties.Moment_Arrow_Size_1)';
            Tmp_Data(14,:) = Tmp_Data(13,:) + (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_1)';
            Tmp_Data(15,:) = Tmp_Data(14,:) + (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_2)';
            Tmp_Data(16,:) = Tmp_Data(15,:) - (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_2)' + (Moment_vector * Graphics.Moment_Length * Graphics_Properties.Moment_Arrow_Size_1)';
            Tmp_Data(17,:) = Tmp_Data(16,:) + (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_1)' - (Moment_vector * Graphics.Moment_Length * Graphics_Properties.Moment_Arrow_Size_1)';
            Tmp_Data(18,:) = Tmp_Data(17,:) - (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_1)';
            Tmp_Data(19,:) = Tmp_Data(18,:) - (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_2)';
            Tmp_Data(20,:) = Tmp_Data(12,:);
            
            Moment_Resultant_Handle = plot3(Axes_Handle, Tmp_Data(:,1), Tmp_Data(:,2), Tmp_Data(:,3));

            set(Moment_Resultant_Handle, 'Color', Graphics_Properties.M_Vector_Color);
            set(Moment_Resultant_Handle, 'LineWidth', Graphics_Properties.Moment_Line_Width);
            set(Moment_Resultant_Handle, 'Tag', 'Moment_Resultant');
            
            if (isequal(get(Graphic_Window_Handle, 'Color'), [0 0 0]))
                Color = 'white';
            else
                Color = 'black';
            end

            Moment_Resultant_Text_Handle = text(Axes_Handle, Tmp_Data(2,1), Tmp_Data(2,2), Tmp_Data(2,3), sprintf('  %.3f', abs(Graphics.Load_Summary.Actual_Total_Moment)));
            set(Moment_Resultant_Text_Handle, 'Color', Color);
            set(Moment_Resultant_Text_Handle, 'FontSize', Graphics_Properties.Moment_Font_Size);
            set(Moment_Resultant_Text_Handle, 'Tag', 'Moment_Resultant_Label');
            
            tmp.Value = 0;
            tmp.Tag = 'Draw_Moment_XYZ_Button';
            GW_Plot_Erase_Resultants(tmp,[]);
            set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 0);
            
        else
            
            delete(findall(Graphic_Window_Handle, 'Tag', 'Moment_Resultant'));
            delete(findall(Graphic_Window_Handle, 'Tag', 'Moment_Resultant_Label'));
            
        end
        
    case 'Draw_Moment_XYZ_Button'
        
        if (src.Value == 1)
            
            MX = dot(Graphics.Load_Summary.Actual_Total_Moment_Vector, DB_COORD{AT_COORD(Graphics.Load_Summary.Summation_Coord)}.e_x);
            MY = dot(Graphics.Load_Summary.Actual_Total_Moment_Vector, DB_COORD{AT_COORD(Graphics.Load_Summary.Summation_Coord)}.e_y);
            MZ = dot(Graphics.Load_Summary.Actual_Total_Moment_Vector, DB_COORD{AT_COORD(Graphics.Load_Summary.Summation_Coord)}.e_z);
            
            % --------- MX ---------
            
            if (MX >= 0)
                Moment_vector = DB_COORD{AT_COORD(Graphics.Load_Summary.Summation_Coord)}.e_x;
            else
                Moment_vector = -DB_COORD{AT_COORD(Graphics.Load_Summary.Summation_Coord)}.e_x;
            end
            
            Tmp_Vector_1 = Graphics.Load.Chord_Surface.A1_projected - Graphics.Load.Chord_Surface.A2_projected;
            Tmp_Vector_1 = Tmp_Vector_1/norm(Tmp_Vector_1);

            Tmp_Vector_2 = cross(Tmp_Vector_1, Moment_vector);
            if (norm(Tmp_Vector_2) < 1e-6)
                Tmp_Vector_2 = cross(Graphics.Load.Vector, Moment_vector);
            end
            Tmp_Vector_2 = Tmp_Vector_2/norm(Tmp_Vector_2);

            Tmp_Vector_1 = cross(Moment_vector, Tmp_Vector_2);
            Tmp_Vector_1 = Tmp_Vector_1/norm(Tmp_Vector_1);

            Tmp_Data = zeros(20,3);

            Tmp_Data(1,:) = Graphics.Load.Summation_Point';
            Tmp_Data(2,:) = Tmp_Data(1,:) + Moment_vector' * Graphics.Moment_Length;
            Tmp_Data(3,:) = Tmp_Data(2,:) - (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_1)' - (Moment_vector * Graphics.Moment_Length * Graphics_Properties.Moment_Arrow_Size_1)';
            Tmp_Data(4,:) = Tmp_Data(3,:) + (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_1)';
            Tmp_Data(5,:) = Tmp_Data(4,:) + (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_2)';
            Tmp_Data(6,:) = Tmp_Data(5,:) - (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_2)' + (Moment_vector * Graphics.Moment_Length * Graphics_Properties.Moment_Arrow_Size_1)';
            Tmp_Data(7,:) = Tmp_Data(6,:) + (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_1)' - (Moment_vector * Graphics.Moment_Length * Graphics_Properties.Moment_Arrow_Size_1)';
            Tmp_Data(8,:) = Tmp_Data(7,:) - (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_1)';
            Tmp_Data(9,:) = Tmp_Data(8,:) - (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_2)';
            Tmp_Data(10,:) = Tmp_Data(2,:);
            Tmp_Data(11,:) = [NaN NaN NaN];
            Tmp_Data(12,:) = Tmp_Data(2,:) - (Moment_vector * Graphics.Moment_Length * Graphics_Properties.Moment_Arrow_Size_1)';
            Tmp_Data(13,:) = Tmp_Data(12,:) - (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_1)' - (Moment_vector * Graphics.Moment_Length * Graphics_Properties.Moment_Arrow_Size_1)';
            Tmp_Data(14,:) = Tmp_Data(13,:) + (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_1)';
            Tmp_Data(15,:) = Tmp_Data(14,:) + (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_2)';
            Tmp_Data(16,:) = Tmp_Data(15,:) - (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_2)' + (Moment_vector * Graphics.Moment_Length * Graphics_Properties.Moment_Arrow_Size_1)';
            Tmp_Data(17,:) = Tmp_Data(16,:) + (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_1)' - (Moment_vector * Graphics.Moment_Length * Graphics_Properties.Moment_Arrow_Size_1)';
            Tmp_Data(18,:) = Tmp_Data(17,:) - (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_1)';
            Tmp_Data(19,:) = Tmp_Data(18,:) - (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_2)';
            Tmp_Data(20,:) = Tmp_Data(12,:);
            
            Moment_XYZ_Handle = plot3(Axes_Handle, Tmp_Data(:,1), Tmp_Data(:,2), Tmp_Data(:,3));

            set(Moment_XYZ_Handle, 'Color', Graphics_Properties.Mx_Vector_Color);
            set(Moment_XYZ_Handle, 'LineWidth', Graphics_Properties.Moment_Line_Width);
            set(Moment_XYZ_Handle, 'Tag', 'Moment_XYZ');
            
            if (isequal(get(Graphic_Window_Handle, 'Color'), [0 0 0]))
                Color = 'white';
            else
                Color = 'black';
            end

            Moment_XYZ_Text_Handle = text(Axes_Handle, Tmp_Data(2,1), Tmp_Data(2,2), Tmp_Data(2,3), sprintf('  %.3f', abs(MX)));
            set(Moment_XYZ_Text_Handle, 'Color', Color);
            set(Moment_XYZ_Text_Handle, 'FontSize', Graphics_Properties.Moment_Font_Size);
            set(Moment_XYZ_Text_Handle, 'Tag', 'Moment_XYZ_Label');
            
            % --------- MY ---------
            
            if (MY >= 0)
                Moment_vector = DB_COORD{AT_COORD(Graphics.Load_Summary.Summation_Coord)}.e_y;
            else
                Moment_vector = -DB_COORD{AT_COORD(Graphics.Load_Summary.Summation_Coord)}.e_y;
            end
            
            Tmp_Vector_1 = Graphics.Load.Chord_Surface.A1_projected - Graphics.Load.Chord_Surface.A2_projected;
            Tmp_Vector_1 = Tmp_Vector_1/norm(Tmp_Vector_1);

            Tmp_Vector_2 = cross(Tmp_Vector_1, Moment_vector);
            if (norm(Tmp_Vector_2) < 1e-6)
                Tmp_Vector_2 = cross(Graphics.Load.Vector, Moment_vector);
            end
            Tmp_Vector_2 = Tmp_Vector_2/norm(Tmp_Vector_2);

            Tmp_Vector_1 = cross(Moment_vector, Tmp_Vector_2);
            Tmp_Vector_1 = Tmp_Vector_1/norm(Tmp_Vector_1);

            Tmp_Data = zeros(20,3);

            Tmp_Data(1,:) = Graphics.Load.Summation_Point';
            Tmp_Data(2,:) = Tmp_Data(1,:) + Moment_vector' * Graphics.Moment_Length;
            Tmp_Data(3,:) = Tmp_Data(2,:) - (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_1)' - (Moment_vector * Graphics.Moment_Length * Graphics_Properties.Moment_Arrow_Size_1)';
            Tmp_Data(4,:) = Tmp_Data(3,:) + (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_1)';
            Tmp_Data(5,:) = Tmp_Data(4,:) + (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_2)';
            Tmp_Data(6,:) = Tmp_Data(5,:) - (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_2)' + (Moment_vector * Graphics.Moment_Length * Graphics_Properties.Moment_Arrow_Size_1)';
            Tmp_Data(7,:) = Tmp_Data(6,:) + (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_1)' - (Moment_vector * Graphics.Moment_Length * Graphics_Properties.Moment_Arrow_Size_1)';
            Tmp_Data(8,:) = Tmp_Data(7,:) - (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_1)';
            Tmp_Data(9,:) = Tmp_Data(8,:) - (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_2)';
            Tmp_Data(10,:) = Tmp_Data(2,:);
            Tmp_Data(11,:) = [NaN NaN NaN];
            Tmp_Data(12,:) = Tmp_Data(2,:) - (Moment_vector * Graphics.Moment_Length * Graphics_Properties.Moment_Arrow_Size_1)';
            Tmp_Data(13,:) = Tmp_Data(12,:) - (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_1)' - (Moment_vector * Graphics.Moment_Length * Graphics_Properties.Moment_Arrow_Size_1)';
            Tmp_Data(14,:) = Tmp_Data(13,:) + (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_1)';
            Tmp_Data(15,:) = Tmp_Data(14,:) + (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_2)';
            Tmp_Data(16,:) = Tmp_Data(15,:) - (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_2)' + (Moment_vector * Graphics.Moment_Length * Graphics_Properties.Moment_Arrow_Size_1)';
            Tmp_Data(17,:) = Tmp_Data(16,:) + (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_1)' - (Moment_vector * Graphics.Moment_Length * Graphics_Properties.Moment_Arrow_Size_1)';
            Tmp_Data(18,:) = Tmp_Data(17,:) - (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_1)';
            Tmp_Data(19,:) = Tmp_Data(18,:) - (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_2)';
            Tmp_Data(20,:) = Tmp_Data(12,:);
            
            Moment_XYZ_Handle = plot3(Axes_Handle, Tmp_Data(:,1), Tmp_Data(:,2), Tmp_Data(:,3));

            set(Moment_XYZ_Handle, 'Color', Graphics_Properties.My_Vector_Color);
            set(Moment_XYZ_Handle, 'LineWidth', Graphics_Properties.Moment_Line_Width);
            set(Moment_XYZ_Handle, 'Tag', 'Moment_XYZ');
            
            if (isequal(get(Graphic_Window_Handle, 'Color'), [0 0 0]))
                Color = 'white';
            else
                Color = 'black';
            end

            Moment_XYZ_Text_Handle = text(Axes_Handle, Tmp_Data(2,1), Tmp_Data(2,2), Tmp_Data(2,3), sprintf('  %.3f', abs(MY)));
            set(Moment_XYZ_Text_Handle, 'Color', Color);
            set(Moment_XYZ_Text_Handle, 'FontSize', Graphics_Properties.Moment_Font_Size);
            set(Moment_XYZ_Text_Handle, 'Tag', 'Moment_XYZ_Label');
            
            % --------- MZ ---------
            
            if (MZ >= 0)
                Moment_vector = DB_COORD{AT_COORD(Graphics.Load_Summary.Summation_Coord)}.e_z;
            else
                Moment_vector = -DB_COORD{AT_COORD(Graphics.Load_Summary.Summation_Coord)}.e_z;
            end
            
            Tmp_Vector_1 = Graphics.Load.Chord_Surface.A1_projected - Graphics.Load.Chord_Surface.A2_projected;
            Tmp_Vector_1 = Tmp_Vector_1/norm(Tmp_Vector_1);

            Tmp_Vector_2 = cross(Tmp_Vector_1, Moment_vector);
            if (norm(Tmp_Vector_2) < 1e-6)
                Tmp_Vector_2 = cross(Graphics.Load.Vector, Moment_vector);
            end
            Tmp_Vector_2 = Tmp_Vector_2/norm(Tmp_Vector_2);

            Tmp_Vector_1 = cross(Moment_vector, Tmp_Vector_2);
            Tmp_Vector_1 = Tmp_Vector_1/norm(Tmp_Vector_1);

            Tmp_Data = zeros(20,3);

            Tmp_Data(1,:) = Graphics.Load.Summation_Point';
            Tmp_Data(2,:) = Tmp_Data(1,:) + Moment_vector' * Graphics.Moment_Length;
            Tmp_Data(3,:) = Tmp_Data(2,:) - (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_1)' - (Moment_vector * Graphics.Moment_Length * Graphics_Properties.Moment_Arrow_Size_1)';
            Tmp_Data(4,:) = Tmp_Data(3,:) + (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_1)';
            Tmp_Data(5,:) = Tmp_Data(4,:) + (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_2)';
            Tmp_Data(6,:) = Tmp_Data(5,:) - (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_2)' + (Moment_vector * Graphics.Moment_Length * Graphics_Properties.Moment_Arrow_Size_1)';
            Tmp_Data(7,:) = Tmp_Data(6,:) + (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_1)' - (Moment_vector * Graphics.Moment_Length * Graphics_Properties.Moment_Arrow_Size_1)';
            Tmp_Data(8,:) = Tmp_Data(7,:) - (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_1)';
            Tmp_Data(9,:) = Tmp_Data(8,:) - (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_2)';
            Tmp_Data(10,:) = Tmp_Data(2,:);
            Tmp_Data(11,:) = [NaN NaN NaN];
            Tmp_Data(12,:) = Tmp_Data(2,:) - (Moment_vector * Graphics.Moment_Length * Graphics_Properties.Moment_Arrow_Size_1)';
            Tmp_Data(13,:) = Tmp_Data(12,:) - (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_1)' - (Moment_vector * Graphics.Moment_Length * Graphics_Properties.Moment_Arrow_Size_1)';
            Tmp_Data(14,:) = Tmp_Data(13,:) + (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_1)';
            Tmp_Data(15,:) = Tmp_Data(14,:) + (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_2)';
            Tmp_Data(16,:) = Tmp_Data(15,:) - (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_2)' + (Moment_vector * Graphics.Moment_Length * Graphics_Properties.Moment_Arrow_Size_1)';
            Tmp_Data(17,:) = Tmp_Data(16,:) + (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_1)' - (Moment_vector * Graphics.Moment_Length * Graphics_Properties.Moment_Arrow_Size_1)';
            Tmp_Data(18,:) = Tmp_Data(17,:) - (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_1)';
            Tmp_Data(19,:) = Tmp_Data(18,:) - (Graphics_Properties.Moment_Arrow_Size_2 * Graphics.Moment_Length * Tmp_Vector_2)';
            Tmp_Data(20,:) = Tmp_Data(12,:);
            
            Moment_XYZ_Handle = plot3(Axes_Handle, Tmp_Data(:,1), Tmp_Data(:,2), Tmp_Data(:,3));

            set(Moment_XYZ_Handle, 'Color', Graphics_Properties.Mz_Vector_Color);
            set(Moment_XYZ_Handle, 'LineWidth', Graphics_Properties.Moment_Line_Width);
            set(Moment_XYZ_Handle, 'Tag', 'Moment_XYZ');
            
            if (isequal(get(Graphic_Window_Handle, 'Color'), [0 0 0]))
                Color = 'white';
            else
                Color = 'black';
            end

            Moment_XYZ_Text_Handle = text(Axes_Handle, Tmp_Data(2,1), Tmp_Data(2,2), Tmp_Data(2,3), sprintf('  %.3f', abs(MZ)));
            set(Moment_XYZ_Text_Handle, 'Color', Color);
            set(Moment_XYZ_Text_Handle, 'FontSize', Graphics_Properties.Moment_Font_Size);
            set(Moment_XYZ_Text_Handle, 'Tag', 'Moment_XYZ_Label');
            
            % ---------------------
            
            tmp.Value = 0;
            tmp.Tag = 'Draw_Moment_Resultant_Button';
            GW_Plot_Erase_Resultants(tmp,[]);
            set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 0);
            
        else
            
            delete(findall(Graphic_Window_Handle, 'Tag', 'Moment_XYZ'));
            delete(findall(Graphic_Window_Handle, 'Tag', 'Moment_XYZ_Label'));
            
        end
        
    case 'Draw_Actual_Pressure_Center_Button'
        
        if (src.Value == 1)
            
            [Sphere_X, Sphere_Y, Sphere_Z] = sphere(Graphics_Properties.Sphere_Mesh_Density);
            
            Tmp_X = Sphere_X*Graphics.Actual_Pressure_Center_Radius + ones(Graphics_Properties.Sphere_Mesh_Density+1)*Graphics.Load_Summary.Actual_Pressure_Center_XYZ_Projected(1);
            Tmp_Y = Sphere_Y*Graphics.Actual_Pressure_Center_Radius + ones(Graphics_Properties.Sphere_Mesh_Density+1)*Graphics.Load_Summary.Actual_Pressure_Center_XYZ_Projected(2);
            Tmp_Z = Sphere_Z*Graphics.Actual_Pressure_Center_Radius + ones(Graphics_Properties.Sphere_Mesh_Density+1)*Graphics.Load_Summary.Actual_Pressure_Center_XYZ_Projected(3);

            Actual_Pressure_Center_Handle = surface(Axes_Handle, Tmp_X, Tmp_Y, Tmp_Z);

            set(Actual_Pressure_Center_Handle, 'FaceColor', Graphics_Properties.Actual_Pressure_Center_Color);
            set(Actual_Pressure_Center_Handle, 'EdgeColor', 'none');
            set(Actual_Pressure_Center_Handle, 'Tag', 'Actual_Pressure_Center');
            
            % Активировать кнопку
            set(findall(Graphic_Window_Handle, 'Tag', 'Label_Actual_Pressure_Center_Button'), 'Enable', 'on');
            
        else
            
            % Удалить данные и деактивировать кнопку
            tmp.Value = 0;
            tmp.Tag = 'Label_Actual_Pressure_Center_Button';
            GW_Plot_Erase_Resultants(tmp,[]);
            set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 0, 'Enable', 'off');
            
            delete(findall(Graphic_Window_Handle, 'Tag', 'Actual_Pressure_Center'));
            
        end
        
    case 'Label_Actual_Pressure_Center_Button'
        
        if (src.Value == 1)
            
            if (isequal(get(Graphic_Window_Handle, 'Color'), [0 0 0]))
                Color = 'white';
            else
                Color = 'black';
            end
            
            switch Graphics_Properties.Language
                case 'RU'
                    
                    switch Graphics.Load.Distributed_Load_Mode
                        case 'CID_DISTR_LOAD'
                            string = '     Фактический центр давления';
                        case 'PRESSURE'
                            string = '     Фактический центр давления (Pn)';
                    end
                    
                case 'EN'
                    
                    switch Graphics.Load.Distributed_Load_Mode
                        case 'CID_DISTR_LOAD'
                            string = '     Actual pressure center';
                        case 'PRESSURE'
                            string = '     Actual Pn pressure center';
                    end
                    
            end
            
            Label_Handle = text(Axes_Handle, Graphics.Load_Summary.Actual_Pressure_Center_XYZ_Projected(1), Graphics.Load_Summary.Actual_Pressure_Center_XYZ_Projected(2), ...
                                             Graphics.Load_Summary.Actual_Pressure_Center_XYZ_Projected(3), string);
            set(Label_Handle, 'Color', Color, 'Tag', 'Actual_Pressure_Center_Label');
            
            % Активировать кнопку
            set(findall(Graphic_Window_Handle, 'Tag', 'Actual_Pressure_Center_Coord_Button'), 'Enable', 'on');
            set(findall(Graphic_Window_Handle, 'Tag', 'Actual_Pressure_Center_Param_Coord_Button'), 'Enable', 'on');
            
        else
            
            % Удалить данные и деактивировать кнопку
            tmp.Value = 0;
            tmp.Tag = 'Actual_Pressure_Center_Coord_Button';
            GW_Plot_Erase_Resultants(tmp,[]);
            set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 0, 'Enable', 'off');
            
            % Удалить данные и деактивировать кнопку
            tmp.Value = 0;
            tmp.Tag = 'Actual_Pressure_Center_Param_Coord_Button';
            GW_Plot_Erase_Resultants(tmp,[]);
            set(findall(Graphic_Window_Handle, 'Tag', tmp.Tag), 'Value', 0, 'Enable', 'off');
            
            delete(findall(Graphic_Window_Handle, 'Tag', 'Actual_Pressure_Center_Label'));
            
        end
        
    case 'Actual_Pressure_Center_Coord_Button'
        
        if (src.Value == 1)
            
            handle = findall(Graphic_Window_Handle, 'Tag', 'Actual_Pressure_Center_Label');
            
            handle_2 = findall(Graphic_Window_Handle, 'Tag', 'Actual_Pressure_Center_Param_Coord_Button');
            
            if (~isempty(handle))
                
                if (handle_2.Value == 0)
                    
                    handle.String = [handle.String sprintf('   [%g, %g, %g]', Graphics.Load_Summary.Actual_Pressure_Center_XYZ_Projected(1), Graphics.Load_Summary.Actual_Pressure_Center_XYZ_Projected(2), ...
                                                                              Graphics.Load_Summary.Actual_Pressure_Center_XYZ_Projected(3))];
                    
                else
                    
                    switch Graphics_Properties.Language
                        case 'RU'

                            switch Graphics.Load.Distributed_Load_Mode
                                case 'CID_DISTR_LOAD'
                                    str_len = 31;
                                case 'PRESSURE'
                                    str_len = 36;
                            end

                        case 'EN'

                            switch Graphics.Load.Distributed_Load_Mode
                                case 'CID_DISTR_LOAD'
                                    str_len = 27;
                                case 'PRESSURE'
                                    str_len = 30;
                            end

                    end
                    
                    handle.String = handle.String(1:str_len);
                    handle.String = [handle.String sprintf('   [%g, %g, %g]', Graphics.Load_Summary.Actual_Pressure_Center_XYZ_Projected(1), Graphics.Load_Summary.Actual_Pressure_Center_XYZ_Projected(2), ...
                                                                              Graphics.Load_Summary.Actual_Pressure_Center_XYZ_Projected(3))];
                                                                          
                    tmp.Value = 1;
                    tmp.Tag = 'Actual_Pressure_Center_Param_Coord_Button';
                    GW_Plot_Erase_Resultants(tmp,[]);
                    
                end

            end
            
        else
            
            switch Graphics_Properties.Language
                case 'RU'
                    
                    switch Graphics.Load.Distributed_Load_Mode
                        case 'CID_DISTR_LOAD'
                            str_len = 31;
                        case 'PRESSURE'
                            str_len = 36;
                    end
                    
                case 'EN'
                    
                    switch Graphics.Load.Distributed_Load_Mode
                        case 'CID_DISTR_LOAD'
                            str_len = 27;
                        case 'PRESSURE'
                            str_len = 30;
                    end
                    
            end
            
            handle = findall(Graphic_Window_Handle, 'Tag', 'Actual_Pressure_Center_Label');
            if (~isempty(handle))
                handle.String = handle.String(1:str_len);
            end
            
            handle = findall(Graphic_Window_Handle, 'Tag', 'Actual_Pressure_Center_Param_Coord_Button');
            
            if (handle.Value == 1)
                tmp.Value = 1;
                tmp.Tag = 'Actual_Pressure_Center_Param_Coord_Button';
                GW_Plot_Erase_Resultants(tmp,[]);
            end
            
        end
        
    case 'Actual_Pressure_Center_Param_Coord_Button'
        
        if (src.Value == 1)
            
            handle = findall(Graphic_Window_Handle, 'Tag', 'Actual_Pressure_Center_Label');
            if (~isempty(handle))
                handle.String = [handle.String sprintf('   [%g, %g]', Graphics.Load_Summary.Actual_Pressure_Center_ksi, Graphics.Load_Summary.Actual_Pressure_Center_etta)];
            end
            
        else
            
            switch Graphics_Properties.Language
                case 'RU'
                    
                    switch Graphics.Load.Distributed_Load_Mode
                        case 'CID_DISTR_LOAD'
                            str_len = 31;
                        case 'PRESSURE'
                            str_len = 36;
                    end
                    
                case 'EN'
                    
                    switch Graphics.Load.Distributed_Load_Mode
                        case 'CID_DISTR_LOAD'
                            str_len = 27;
                        case 'PRESSURE'
                            str_len = 30;
                    end
                    
            end
            
            handle = findall(Graphic_Window_Handle, 'Tag', 'Actual_Pressure_Center_Label');
            if (~isempty(handle))
                handle.String = handle.String(1:str_len);
            end
            
            handle = findall(Graphic_Window_Handle, 'Tag', 'Actual_Pressure_Center_Coord_Button');
            
            if (handle.Value == 1)
                tmp.Value = 1;
                tmp.Tag = 'Actual_Pressure_Center_Coord_Button';
                GW_Plot_Erase_Resultants(tmp,[]);
            end
            
        end
        
end
